package org.ithang.tools.lang;

import java.util.List;

import org.ithang.application.grade.bean.Grade;

public class GradeUtil {

	/**
	 * 得到加速率，如果是0表示不加速
	 * @param grades
	 * @param amount
	 * @return
	 */
	public static double getRate(List<Grade> grades,double amount){
		double rate=0D;
		if(null!=grades&&!grades.isEmpty()){
			for(Grade grade:grades){
				if(amount>=grade.getAdot()){
					if(rate<grade.getBonus_rate()){
						rate=grade.getBonus_rate();
					}
				}
			}
		}
		return rate;
	}
}
